<?php
class xl_parent{
    function print_list($list,$id,$characters){
        foreach($list as $element){
            if($element['parent']==$id){
                echo '<option value="'.$element['id'].'">'.$characters,$element['category_name'].'</option>';
            }
        }
        print_list($list,$element['id'],$characters.$characters);
    }
}